<template>
	<view>
		<view class="container">
			<view class="header boxS">
				<view class="h-item">
					<input type="text" placeholder="请输入收货人姓名" v-model="taddress.name" />
				</view>
				<view class="h-item">
					<input type="number" placeholder="请输入收货人手机号" v-model="taddress.mobile" maxlength="11" @input="input"/>
				</view>
			</view>
			<view class="header boxS" style="margin-top: 23rpx;">
				<view class="h-item">
		
					<view class="color3" @click="showdz = true" style="padding-right: 34rpx;position: relative;display: flex;align-items: center;width: 100%;">
						<text style="color: #989898;" v-show="!taddress.city">请选择省.市.区</text>
						<text style="color: #333333;" v-show="taddress.city"><text>{{taddress.mcprovince}}</text><text style="margin-left: 10rpx;">{{taddress.mccity}}</text><text style="margin-left: 10rpx;">{{taddress.mcdistrict}}</text></text>
					</view>
				</view>
				<view class="h-item color3" style="height: 149rpx;margin-top: 37rpx;">
					<textarea style="height: 100%;width: 100%;" placeholder="请输入详细地址" v-model="taddress.address"></textarea>
				</view>
			</view>
			<view class="header boxS" style="margin-top: 76rpx;">
				<view class="h-item" style="justify-content: initial;">
					<view>地址标签</view>
					<view class="color3"
					 style="display: flex;text-align: left;"
						v-for="(item,index) in tabList" :key="item.id" 
						@click="tab(item.id)"
						>
						<view class="attr1" :class="[{'active': active === item.id}]">{{item.name}}</view>
					</view>
				</view>
				<view class="h-item">
					<view>设为默认地址</view>
					<view class="color3">
						<u-switch :active-value="1" :inactive-value="0" v-model="activetrue" size="38" active-color="#41CB05" @change="change"></u-switch>
					</view>
				</view>
			</view>
			<Taddress :title="'地址'" :showdz="showdz" @confirmdz="confirmdz" @close="close"></Taddress>
			<view class="baoBtn">
				<view class="footerplgl" @click="delAddress">
					删除地址
				</view>
				<view class="fabucheyuan" @tap="keepData">
					保存地址
				</view>
			</view>
		</view>
	</view>
</template>

<script src="./editAddress.js"></script>
<style lang="scss" scoped>
	@import './editAddress.scss';
</style>
